build: gate SwiftPM build system behind KEYPATH_BUILD_SYSTEM env var#925
Conversation
Xcode-beta / macOS 27 beta default SwiftPM to the new "swiftbuild" build system, which fails with "unable to open dependencies file" and writes artifacts to .build/out/... instead of the .build/arm64-apple-macosx/release layout these scripts assume. Allow forcing the system per-machine via KEYPATH_BUILD_SYSTEM (e.g. =native) while leaving the default behavior unchanged when the var is unset — safe for CI and toolchains that don't recognize --build-system. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code ReviewOverviewThis PR adds a The motivation is solid and the risk profile is low. Issues & Suggestions1. Two Scripts May Be Missing —
|
Why
On macOS 27 beta with Xcode-beta, SwiftPM defaults to the new
swiftbuildbuild system, which:error: unable to open dependencies file (...KeyPathCore-primary.d).build/out/...instead of the.build/arm64-apple-macosx/releaselayout these scripts already assumeThe build scripts were written for the classic
nativebuild system (see the hardcoded path inbuild-and-sign.sh). A toolchain flipping the default toswiftbuildsilently breaks the pipeline.What
Gate the build system behind an optional
KEYPATH_BUILD_SYSTEMenv var in the three scripts that invokeswift build:Scripts/build-and-sign.shScripts/build-helper.shScripts/quick-deploy.shWhen the var is unset, behavior is unchanged (no
--build-systemflag passed) — safe for CI and any toolchain that doesn't recognize the flag. On affected machines, setexport KEYPATH_BUILD_SYSTEM=native.Test
bash -npasses on all three scripts./build.sh(build → sign → notarize → staple → deploy → launch) verified end-to-end on macOS 27 beta withKEYPATH_BUILD_SYSTEM=native🤖 Generated with Claude Code